using System;
using Newtonsoft.Json;

namespace FBGraph.Models
{
    /// <summary>A status message on a user's wall</summary>
    /// <remarks>
    /// <para>Example: https://graph.facebook.com/367501354973 (A status message from Bret Taylor)</para>
    /// </remarks>
    public partial class StatusMessage : IFBGraphResult
    {
        /// <summary>The status message ID</summary>
        [JsonPropertyAttribute("id")]
        public Nullable<Int64> Id { get; set; }
        
        /// <summary>An object containing the name and ID of the user who posted the message</summary>
        [JsonPropertyAttribute("from")]
        public From From { get; set; }
        
        /// <summary>The status message content</summary>
        [JsonPropertyAttribute("message")]
        public String Message { get; set; }
        
        /// <summary>The time the message was published</summary>
        [JsonPropertyAttribute("updated_time")]
        public Nullable<DateTime> UpdatedTime { get; set; }
        
        /// <summary>Gets or sets a <see cref="Boolean" /> value representing whether the object has been populated.</summary>
        Boolean IFBGraphResult.IsReady { get; set; }
        /// <summary>Updates the current model with values from another like-typed model.</summary>
        /// <param name="other">The source model.</param>
        /// <remarks>This is used for asynchronous calls to update the reference that was returned when the original API method was called.</remarks>
        void IFBGraphResult.UpdateFrom(IFBGraphResult other)
        {
            var that = other as StatusMessage;
            if (that == null) return;
            else
            {
                this.Id = that.Id;
                this.From = that.From;
                this.Message = that.Message;
                this.UpdatedTime = that.UpdatedTime;
                ((IFBGraphResult)this).IsReady = true;
            }
            
        }
    }
}